﻿@using SCMS.Resources
@model SCMS.UI.Models.GarageInfor
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "fleetDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action(ViewBag.Action),
      OnSuccess = string.Format("usermsg('{0}');CloseDialog();initPostFundsView(2);", Resources_frank.Global_String_ProcessCompleted),
      OnFailure = "javascript:errormsg()"
  };}
<script src="@Url.Content("~/Scripts/js/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form", id = "frmGarageInfo" }))
{
    @Html.ValidationSummary(true)
    <br />
    @Html.HiddenFor(model => model.EntityGarageInfo.Id)
    @Html.HiddenFor(model => model.EntityGarageInfo.FleetId)
    @Html.HiddenFor(model => model.EntityGarageInfo.IssueDate)
    <table width="98%" align="center" cellpadding="0">
        <tr class="gridheader2">
            <td align="center">
                @Resources_frank.FleetManager_LoadFleetDetails_GarageName
            </td>
            <td align="center">
                @Resources_frank.FleetManager_LoadFleetDetails_DateTaken
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityGarageInfo.SupplierId, Model.Suppliers, Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.SupplierId, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityGarageInfo.Dateken)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.Dateken, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center">
                @Resources_frank.FleetManager_LoadNewGarageInfo_ReasonType
            </td>
            <td align="center">
                @Resources_frank.FleetManager_LoadFleetDetails_CurrentMileage
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityGarageInfo.ReasonType, new SelectList(
                        new List<Object>{ 
                            new { value = "Service" , text = Resources_frank.Global_String_Service  },
                            new { value = "Repair" , text = Resources_frank.Global_String_Repair },
                            new { value = "Assessment" , text = Resources_frank.Global_String_Assessment }
                        }, "value", "text"), Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.ReasonType, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityGarageInfo.IfServiceCurrentMilleage)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.IfServiceCurrentMilleage, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center">
                @Resources_frank.FleetManager_LoadFleetDetails_NextMileage
            </td>
            <td align="center">
                @Resources_frank.Global_String_OtherDetails
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityGarageInfo.IfServiceNextMilleage, new SelectList(
                new List<Object>{ 
                    new { value = "5000" , text = "5,000"  },
                    new { value = "10000" , text = "10,000" },
                    new { value = "15000" , text = "15,000"},
                    new { value = "20000" , text = "20,000"},
                    new { value = "25000" , text = "25,000"}
                }, "value", "text"), Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.IfServiceNextMilleage, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityGarageInfo.OtherProblemsDescription)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.OtherProblemsDescription, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center">
                @Resources_frank.Global_String_Currency
            </td>
            <td align="center">
                @Resources_frank.Global_String_Cost
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.DropDownListFor(x => x.EntityGarageInfo.CurrencyId, Model.Currencies, Resources_frank.Global_String_PleaseSelect)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.CurrencyId, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityGarageInfo.Cost)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.Cost, Resources_frank.Global_String_Required)
            </td>
        </tr>
        <tr class="gridheader2">
            <td align="center">
                @Resources_frank.FleetManager_LoadFleetDetails_DateOut
            </td>
            <td align="center">
                @Resources_frank.FleetManager_LoadFleetDetails_MileageOut
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityGarageInfo.DateOutOfGarage)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.DateOutOfGarage, Resources_frank.Global_String_Required)
            </td>
            <td align="center" valign="top">
                @Html.EditorFor(x => x.EntityGarageInfo.MilleageOut)
                @Html.ValidationMessageFor(x => x.EntityGarageInfo.MilleageOut, Resources_frank.Global_String_Required)
            </td>
        </tr>
    </table>
    <hr />
               
    <center>
        <input type="submit" class="btn green" value="  @Resources_frank.Global_String_Save  " /></center>
}
